package com.example.database.controller;

import com.example.database.bean.*;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
public class HtmlController {
    @RequestMapping("/login")
    public String kkk(){
        return "login";
    }

    @RequestMapping("/MainInterface")
    public String test6(@ModelAttribute("login") User s){
        return "show";
    }

    @RequestMapping("html")
    public String html(){
        return "counter";
    }

    @RequestMapping("main")
    public String main(){
        return "main";
    }

    @RequestMapping("main1")
    public String main1(){
        return "main1";
    }

    @RequestMapping("top")
    public String top(){
        return "top";
    }

    @RequestMapping("left")
    public String left(){
        return "left";
    }

    @RequestMapping("left1")
    public String left1(){
        return "left1";
    }

    @RequestMapping("selectAll")
    public String selectAll(){
        return "selectAll";
    }

    @RequestMapping("tongji")
    public String tongji(){
        return "tongji";
    }

    @RequestMapping("xiaoshou")
    public String xiaoshou(){
        return "xiaoshou";
    }

    @RequestMapping("shouhuo")
    public String showhuo(){
        return "shouhuo";
    }

    @RequestMapping("xuanxiang")
    public String xuanxiang(){
        return "xuanxiang";
    }

    @RequestMapping(value="biaoge")
    public String biaoge(Model model){
        List<tongji> tj=new ArrayList<tongji>();
        tj.add(new tongji(1,"a","aa",101,101));
        tj.add(new tongji(2,"b","bb",102,102));
        tj.add(new tongji(3,"c","cc",103,103));
        tj.add(new tongji(4,"d","dd",104,104));
        model.addAttribute(tj);
        return "biaoge";
    }

    @RequestMapping(value="biaoge1")
    public String biaoge1(Model model){
        List<shouhuo> sh=new ArrayList<shouhuo>();
        sh.add(new shouhuo(1,1,"a","aa",101,101));
        sh.add(new shouhuo(2,2,"b","bb",102,102));
        sh.add(new shouhuo(3,3,"c","cc",103,103));
        sh.add(new shouhuo(4,4,"d","dd",104,104));
        model.addAttribute(sh);
        return "biaoge1";
    }

    @RequestMapping("biaoge2")
    public String biaoge2(){
        return "biaoge2";
    }

    @RequestMapping("biaoge3")
    public String biaoge3(){
        return "biaoge3";
    }

    @RequestMapping("goods")
    public String goods(){
        return "goods";
    }

    @RequestMapping("anInfor")
    public String anInfor(){
        return "anInfor";
    }

    @RequestMapping(value="purchase")
    public String purchase(Model model){
        List<jinhuo> pc=new ArrayList<jinhuo>();
        pc.add(new jinhuo(1,1,1,"a",101,101,"a","aa","aaa"));
        pc.add(new jinhuo(2,2,2,"b",102,102,"b","bb","bbb"));
        pc.add(new jinhuo(3,3,3,"c",103,103,"c","cc","ccc"));
        pc.add(new jinhuo(4,4,4,"d",104,104,"d","dd","ddd"));
        model.addAttribute(pc);
        return "purchase";
    }

    @RequestMapping(value="assignment")
    public String assignment(Model model){
        List<fenpai> fp=new ArrayList<fenpai>();
        fp.add(new fenpai(1,1,1,"a",101,101,"a","aa","aaa","aaa"));
        fp.add(new fenpai(2,2,2,"b",102,102,"b","bb","bbb","bbb"));
        fp.add(new fenpai(3,3,3,"c",103,103,"c","cc","ccc","ccc"));
        fp.add(new fenpai(4,4,4,"d",104,104,"d","dd","ddd","ddd"));
        model.addAttribute(fp);
        return "assignment";
    }

    @RequestMapping(value="sale")
    public String sale(Model model){
        List<xiaoshou1> xs=new ArrayList<xiaoshou1>();
        xs.add(new xiaoshou1(1,"a",101,101,"aa","aaa"));
        xs.add(new xiaoshou1(2,"b",102,102,"bb","bbb"));
        xs.add(new xiaoshou1(3,"c",103,103,"cc","ccc"));
        xs.add(new xiaoshou1(4,"d",104,104,"dd","ddd"));
        model.addAttribute(xs);
        return "sale";
    }

    @RequestMapping(value="stock")
    public String stock(Model model){
        List<kucun> kc=new ArrayList<kucun>();
        kc.add(new kucun(1,"a",101,"a"));
        kc.add(new kucun(2,"b",102,"b"));
        kc.add(new kucun(3,"c",103,"c"));
        kc.add(new kucun(4,"d",104,"d"));
        model.addAttribute(kc);
        return "stock";
    }

    @RequestMapping(value="lossApurse")
    public String lossApurse(Model model){
        List<jsduibi> jd=new ArrayList<jsduibi>();
        jd.add(new jsduibi(1,"a",101,101,101,101,101,101));
        jd.add(new jsduibi(2,"b",102,102,102,102,102,102));
        jd.add(new jsduibi(3,"c",103,103,103,103,103,103));
        jd.add(new jsduibi(4,"d",104,104,104,104,104,104));
        model.addAttribute(jd);
        return "lossApurse";
    }

    @RequestMapping(value="storeCompare")
    public String storeCompare(Model model){
        List<fdduibi> fd=new ArrayList<fdduibi>();
        fd.add(new fdduibi(1,"a","aa",101,101));
        fd.add(new fdduibi(2,"b","bb",102,102));
        fd.add(new fdduibi(3,"c","cc",103,103));
        fd.add(new fdduibi(4,"d","dd",104,104));
        model.addAttribute(fd);
        return "storeCompare";
    }

}

